package forms;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class formAddReviewer extends ActionForm {
	private static final long serialVersionUID = 1L;

	private String username = null;
	private String password = null;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void reset(ActionMapping mapping, HttpServletRequest request) {
		setUsername(null);
		setPassword(null);
	}

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {

		ActionErrors errors = new ActionErrors();

		if ((username == null) || (username.length() < 1))
			errors.add("firstMsgTag1", new ActionMessage("errors.required",
					"Reviewer Username"));

		if ((password == null) || (password.length() < 1))
			errors.add("lastMsgTag1", new ActionMessage("errors.required",
					"Reviewer Password"));
		return errors;
	}
}
